class Spirit {
  constructor(path) {
    this.img = utils.imageFromPath(path)
    this.x = 0
    this.y = 0
    this.w = this.img.width
    this.h = this.img.height

    this.loaded = false
    this.img.onload = () => {
      this.loaded = true
    }
  }

  static new(...args) {
    return new this(...args)
  }

  draw(context) {
    if (this.loaded) {
      context.drawImage(this.img, this.x, this.y)
    }
  }
}